/*
 * =====================================================================================
 *
 *       Filename:  bp_observer.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  10/03/2010 06:51:35 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Ken Chen (Ziliang), zlchen.ken@gmail.com
 *        Company:  EMC
 *
 * =====================================================================================
 */

#include "bp_observer.h"
#include "observable.h"
#include "bp_sensor.h"

BPObserver::BPObserver()
	: itsPressure( 0.0 )
{
}

void BPObserver::update( Observable* subject )
{
  BarometricPressureSensor *bps = dynamic_cast<BarometricPressureSensor*>( subject );
	if( bps != NULL )
	{
  	itsPressure = bps->getBarometricPressure();
//		std::cout << "pressure changed : " << pressure << endl;
	}
}
